<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #ul1{
            background: aqua;
        }
    </style>
</head>
<body> 
     <button>点击</button>
    <ul id="ul1">
       <li>1222</li>
       <li>2</li>
       <li>2</li>
       <li>2</li>
       <li>54</li>
   </ul>
   <ul id="ul2">
        <li>1222</li>
        <li>2</li>
        <li>2</li>
        <li>2</li>
        <li>54</li>
    </ul>
   <a href="#" target="_black"></a>
    <p id="p1">文档节点</p>
  
  
</body>
     <script>
        var hid = document.getElementById('p1');
        console.log(hid)
     
        var button = document.querySelector('button');
        var x=document.getElementById("ul1");  
        console.log(button)
        button.onclick = function (){
	        var x=document.getElementById("ul1");  
            x.innerHTML = x.firstChild.nodeName;
            var c = document.querySelector('a');
            c.innerHTML = c.getAttributeNode('href').value;
            console.log(x);
            var p0=document.getElementsByTagName('ul')[1];
            p0.getElementsByTagName('li')[0].innerHTML = 'ghjs'
            // console.log(p0);
            var list=document.getElementById("ul2");
	            list.removeChild(list.childNodes[2]);
        }
       var h = document.createElement('h1')
       console.log(h)
       h.innerHTML ='创建新节点';
        document.body.appendChild(h)
    </script>
</html>